﻿<div ng-controller="notaController">

    <form class="form-horizontal" ng-submit="save()" ng-show="formVisibility">
        <div class="form-group">
                <label class="control-label col-xs-3">Estudiante ID:</label>
            <div class="col-xs-9">
                <select ng-model="nota.StudentId"
                        ng-options="value.Id as value.Nombre for value in studentList">
                    <option>--</option>
                </select>{{nota.StudentId}}
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-3">Curso ID:</label>
            <select ng-model="nota.CursoId"
                    ng-options="value.CursoId as value.Nombrec for value in cursoList">
                <option>--</option>
            </select>{{nota.CursoId}}
        </div>
        <div class="form-group">
            <label class="control-label col-xs-3">Nota_curso:</label>
            <div class="col-xs-9">
                <input type="text" class="form-control" placeholder="nota del curso" ng-model="nota.CursoNot" required>
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-3">Promedio:</label>
            <div class="col-xs-9">
                <input type="text" class="form-control" placeholder="promedio" ng-model="nota.Promedio" required>
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-3">Fecha_ingreso:</label>
            <div class="col-xs-9">
                <input type="date" class="form-control" placeholder="F.ingreso" ng-model="nota.FechaI" required>
            </div>
        </div>
        <br>
        <div class="form-group">
            <div class="col-xs-offset-3 col-xs-9">
                <button type="button" class="btn btn-default" ng-click="cancel()">Cancel </button>
                <button class="btn btn-success" type="submit">Save</button>
            </div>
        </div>

    </form>
    <div class="container">
        <h3>LISTA DE Notas</h3>
        <table class="table table-bordered table-striped">
            <tr>
                <th>NombreAl</th>
                <th>Nombrec</th>
                <th>CursoNot</th>
                <th>Promedio</th>
                <th>Fecha de Ingreso</th>
                <th>Opciones</th>
            </tr>

            <tr data-ng-repeat="d in list">
                <td>{{d.StudentModel.Nombre}}</td>
                <td>{{d.CursoModel.Nombrec}}</td>
                <td>{{d.CursoNot}}</td>
                <td>{{d.Promedio}}</td>
                <td>{{d.FechaI | date:'dd/MM/yyyy'}}</td>

                <td>
                    <button ng-click="getById(d)" type="button" class="btn btn-primary"><i class="glyphicon glyphicon-pencil"></i> <span>Editar</span></button>
                    <button ng-click="delete(d)" type="button" class="btn btn-danger"><i class="glyphicon glyphicon-trash"></i> <span>Eliminar</span></button>
                </td>

            </tr>
        </table>
    </div>
    <button ng-click="ShowForm()" ng-hide="formVisibility" type="button" class="btn btn-primary"><i class="glyphicon glyphicon-plus"></i> Agregar Nota</button>
</div>